﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;

namespace Himp.Platform
{
    /// <summary>
    /// 
    /// </summary>
    public class OpenApiFuncConfig : FullAuditedAggregateRoot<Guid>, IMultiTenant
    {
        /// <summary>
        /// 功能代码
        /// </summary>
        public string FuncCode { get; set; }

        /// <summary>
        /// 功能名称
        /// </summary>
        public string FuncName { get; set; }

        /// <summary>
        /// 分类编码
        /// </summary>
        public string CatgeCodg { get; set; }

        /// <summary>
        /// 分类名称
        /// </summary>
        public string CatgeName { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        public string Descr { get; set; }

        /// <summary>
        /// 服务名称
        /// </summary>
        public string ServiceName { get; set; }

        /// <summary>
        /// 方法名称
        /// </summary>
        public string MethodName { get; set; }

        /// <summary>
        /// 请求类型
        /// 0 GET
        /// 1 POST
        /// 2 PUT
        /// 3 DELETE
        /// </summary>
        public int ReqType { get; set; }

        /// <summary>
        /// 参数类型
        /// </summary>
        public string ParameterType { get; set; }

        /// <summary>
        /// 0 SM2
        /// 1 SM3
        /// </summary>
        public int SignType { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public int SrtNo { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public int Ver { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public int OpenApiSats { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public Guid? TenantId { get; set; }

        public OpenApiFuncConfig()
        { 
        
        }

        public OpenApiFuncConfig(string serviceName, string methodName
            , string parameterType, int reqType, string funcName, string catgeCodg
            , string catgeName, int srtNo, string? descr)
        {
            ServiceName = serviceName;
            MethodName = methodName;
            ParameterType = parameterType;
            ReqType = reqType;
            FuncCode = $"{serviceName}.{methodName}";
            FuncName = funcName;
            CatgeCodg = catgeCodg;
            CatgeName = catgeName;
            SrtNo = srtNo;
            Descr = descr ?? string.Empty;
            SignType = 1;
            Ver = 1;
            OpenApiSats = 0;
        }
    }
}
